<template>
	<view class="msg-box" >
		<view class="curd-head">
			<view class="curd-title">
				<view>{{itemDetail.reserveOrderCode || ''}}</view>
				<view >
					{{itemDetail.carLicense}}
				</view>
			</view>
			<view class="statusType">
				<u-icon name="phone" size="48" @click="makeCall"></u-icon>
			</view>
		</view>
		<view class="order-details" @click="toDetails(itemDetail)">
			<view class="order-item" v-for="(item,index) in orderitem" :key="index">
				<view>{{item.label}}</view>
				<view>{{itemDetail[item.model]}}</view>
			</view>
		</view>		
		<view class="btn" >
			<view>
				服务顾问：
				<view class="adviser-name">{{itemDetail.saEmpName}}</view>
			</view>
			<view>
				<!-- <u-button type="primary" size="medium" v-if="listType === 2" plain @click="Acceptance">申请结算</u-button> -->
				<view class="price" v-if="listType === 3">
					<view>
						￥
					</view>					
					<view>
						{{itemDetail.factAmount}}
					</view>
				</view>
			</view>
			
		</view>
	</view>
</template>

<script>
	export default {
		props:{
			listType:{type:Number,default:0},
			itemDetail:{type:Object,default:()=>{}},
		},
		data(){
			return{				
				status:[
					{
						label:'客户投诉',
					},{
						label:'客户咨询'
					}					
				],
				orderitem:[
							{
								label:'客户姓名',
								model:'custName'
							},{
								label:'电话号码',
								model:'custTel'
							},{
								label:'进厂时间',
								model:'repairTime'
							},{
								label:'预计交付时间',
								model:'preGetDate'
							}
						]
			}
		},
		methods:{
			toDetails(item){
				const url = '/pages/views/repairBill/add'
				const params = {
					listType:this.listType,
					pageType:'details',
					repairOrderId:item.repairOrderId,
					vin:item.vin
					// reserveOrderId: this.itemDetail.reserveOrderId,
					// statusCode:this.statusCode
				}
				this.$navTo.togo(url,params)
			},
			makeCall(){
				return 
				uni.makePhoneCall({
				    phoneNumber: this.itemDetail.custTel 
				});
			},
			Acceptance(){
				this.$emit('Acceptance',this.itemDetail)
			}
		}
	}
</script>

<style lang="scss" scoped>
	@import './index.scss';
</style>
